<?php								
	function NumberToPrice( $nInt )
	{
		$strInt = (string)$nInt;
		$strPrice = "$";
		$nLen = strlen( $strInt );			// 0,123,456,789
		$nStr = $nLen % 3;	
		if( $nLen < 3 )
		{
			$strPrice .= $strInt;
		}
		else
		{
			if( $nStr > 0)
			{
				$strPrice .= substr( $strInt, 0, $nStr ). ",";
			}
			for( $i = $nStr ; $i < $nLen ; $i+=3 )
			{
				$strPrice .= substr( $strInt, $i, 3 );
				if( $i + 3 < $nLen )
				{
					$strPrice .= ',';
				}
			}
		}
		return $strPrice;
	}

?>